# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
# Maintainer:
pkgname=octoprint-firmwarecheck
pkgver=2021.10.11
pkgrel=2
pkgdesc="Checks for unsafe or broken printer firmwares"
url="https://github.com/OctoPrint/OctoPrint-FirmwareCheck"
arch="noarch"
license="AGPL-3.0-only"
depends="octoprint"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
options="!check" # no tests
subpackages="$pkgname-pyc"
source="https://github.com/OctoPrint/OctoPrint-FirmwareCheck/archive/refs/tags/$pkgver/OctoPrint-FirmwareCheck-$pkgver.tar.gz"
builddir="$srcdir/OctoPrint-FirmwareCheck-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages testenv
	testenv/bin/python3 -m installer .dist/*.whl
	testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1916d1fb23869aec9eb8f7a837d9622e04fef551701874f5c82f4066bc1a9a6d46bead6cd0c7bd7c1a87bff30449be147534f9f3d94d21294c7f6d1ee8d9faf6  OctoPrint-FirmwareCheck-2021.10.11.tar.gz
"
